@import (reference) "../defs.less";
@import (reference) "./admin.less";

@img_base: "../../images/";

#custom_policy_editor {
  margin: 0;
  width: 65em;

  p {
    font-size: 110%;
    margin: 1em;
  }

  .CodeMirror {
    border-top: 1px #DDD solid;
    border-bottom: 1px #DDD solid;
  }
}

.config-forms-container .config-forms-page-content {
  .config-site-api-tokens {
    .config-api-token-note {
      color: #888;

      &.empty {
        color: #CCC;
        font-style: italic;
      }
    }

    .config-api-token-value {
      font-family: monospace;
      font-size: 120%;
    }

    .config-forms-list-action-label-policy-custom {
      color: blue;
      cursor: pointer;
      text-decoration: underline;
    }

    .config-forms-list-action-policy {
      text-align: right;
      width: 6.5em;
    }

    .generate-api-token {
      background: white;

      a {
        color: blue;
        font-size: 90%;
        text-decoration: none;
      }
    }

    .rb-icon {
      vertical-align: middle;
    }
  }
}

#page_oauth2 {
  .app-entry-wrapper {
    overflow: hidden;
  }

  .config-app-name {
    &.disabled a {
      font-style: italic;
    }

    .rb-icon {
      vertical-align: middle;
    }

    a {
      vertical-align: middle;
    }
  }

  .config-forms-list {
    &:empty {
      display: none;

      + .app-list-empty {
        display: block;
      }
    }

    > :last-child {
      border-bottom: 1px solid #AAAAAA;
    }

    .config-forms-list-item {
      white-space: unset;
    }
  }

  .app-list-empty {
    display: none;
    background: #FFFFFF;
    border-top: 1px solid #AAAAAA;
    border-bottom: 1px solid #AAAAAA;
    line-height: 32px;
    padding: 0.3em 0.3em 0.3em 1.5em;
  }

  .disabled-warning {
    margin-bottom: 1em;
  }


  p {
    line-height: normal;
  }
}

.oauth-add-app {
  margin-top: 1em;
}

.edit-oauth2-app {
  fieldset:extend(.change-form fieldset all) {
    margin: 0;
    padding:0;
  }

  h2:extend(.module h2) {
    border-top: 1px solid @box-border-color;
    border-bottom: 1px solid @box-border-color;
    margin: 0;
    padding: 4px (2 * @box-main-padding);
    text-transform: none;
  }

  input[type="text"]:extend(input) {}

  ul.errorlist:extend(ul.errorlist all) {}

  #id_client_secret_container:extend(
    #application_form #id_client_secret_container) {}

  #id_redirect_uris_container li {
    padding: 0.25em 0;
  }

  .box-main {
    padding: 0;

    > .errorlist {
      border-bottom: 1px solid @box-border-color;
      display: block;

      li {
        margin-bottom: 0;
      }
    }
  }

  .form-actions {
    padding: 0 @box-padding @box-padding @box-padding;

    a.btn, input {
      margin-right: 1em;
    }
  }

  .form-row {
    margin: inherit -1px;
    padding: auto (2 * @box-main-padding);

    &.errors:extend(.errors all) {}
  }

  .help:extend(.help) {}

  .list-edit-widget ul {
    list-style: none;
  }

  .regenerate-secret-button {
    margin-top: 1px;
  }
}
